#include "common.h"
#include "xplayer.h"
//-----------------------------------------------------------------------------
XPlayer::XPlayer(XGame * pGame)
{
    game=pGame;
    printf("XPlayer -> Construktor\n");
}
//-----------------------------------------------------------------------------
XPlayer::~XPlayer()
{
    printf("XPlayer -> Destruktor\n");
}
//-----------------------------------------------------------------------------
void XPlayer::init(XTank * plTank,int posx,int posy)
{
    printf("XPlayer -> Init()\n");
    playerTank=plTank;
}
//-----------------------------------------------------------------------------
void XPlayer::draw()
{
}
//-----------------------------------------------------------------------------
void XPlayer::process()
{
}
//-----------------------------------------------------------------------------
void XPlayer::processInput()
{
    Uint8 * keys = SDL_GetKeyState(NULL);

    if(keys[SDLK_UP])
    {
        playerTank->speedUp(); 
    }
    else
    if(keys[SDLK_DOWN])
    {
        playerTank->speedDown(); 
    }
    else
        playerTank->setNullAccel();

    if(keys[SDLK_LEFT])
    {
        playerTank->turnToLeft(); 
    }
    
    if(keys[SDLK_RIGHT])
    {
        playerTank->turnToRight(); 
    }
}
//-----------------------------------------------------------------------------
